<!-- 音乐盒头部 -->
<template>
   <div class="content-top">
       <span> 幻音宝盒</span>
       <input type="search" v-model="inpVal" @keyup.enter="getMsg">
    </div>
</template>

<script>
export default {
    created() {
        this.getMsg()
    },
  data () {
    return { 
        inpVal:""||"热门",
        songList:[]
    }
  },

  methods: {
      getMsg:function(){
        //   console.log("111111")
          this.$axios.get("/search",{
                params: {
                keywords:this.inpVal,
                },
          }).then((result) => {
              
              this.songList=result.data.result.songs
              this.$emit("sendMsg",this.songList)
          }).catch((err) => {
              console.log(err)
          });
          this.inpVal=""
      }
  }
}

</script>
<style lang='scss' scoped>
</style>